package coredb;

import java.text.ParseException;
import java.util.List;
import javax.persistence.NoResultException;


/** Defines functionalities that has been implemented for various operations
 *
 * @author lol
 */
public interface Functionalities {
    
    /** Limit of amount for which PAN may be required
     * @value 200000.0
     */
    static final double PAN_REQUIRED_LT = 200000.0;
    
    /** internal,returned when account is not created by createAccount
     * @value -1
     */
    static final long ACCOUNT_NOT_CREATED = -1;
    
    static final long ACCOUNT_NOT_FOUND = -1;
    
    static final int MAX_WITHDRAWL_COUNT = 2;
    
    static final double MAX_WITHDRAWL_AMOUNT = 25000.0;

    /**
     *
     * @param name
     * @param dob
     * @param pan
     * @param bal
     * @return
     */
    long createAccount(String name, String dob, String pan, double bal) throws CustomerExistsException;

    /**
     *
     * @param name
     * @param dob
     * @param pan
     * @return
     */
    Customer createCustomer(String name, String dob, String pan) throws CustomerExistsException;

    /**
     *
     * @param accNo
     * @param amount
     * @return
     */
    boolean deposit(long accNo, double amount) throws NoResultException;

    /**
     *
     * @param accNo
     * @param amount
     * @param pan
     * @return
     */
    boolean deposit(long accNo, double amount, String pan) throws NoResultException;

    /**
     *
     * @return
     */
    List<Account> getAllAccounts();

    /**
     *
     * @param accNo
     * @return
     */
    double getBal(long accNo);

    /**
     *
     * @return
     */
    public List<Transaction> getDailyReport();

    /**
     *
     * @param start
     * @param end
     * @return
     */
    List<Transaction> getTxnReport(long accNo, String start, String end) throws ParseException;

    /**
     *
     * @param a
     * @param amount
     * @param typeOfTxn
     */
    boolean recordTransaction(Account a, double amount, String typeOfTxn);

    // TODO: to implement and check cases !!!!!!!!!!!!!
    /**
     *
     * @param accNo
     * @param amount
     * @return
     */
    boolean withdraw(long accNo, double amount) throws NoResultException;

    /**
     *
     * @param accNo
     * @param date
     * @return
     */
    double withdrawlAmount(long accNo) throws ParseException;

    /**
     *
     * @param accNo
     * @return
     */
    int withdrawlCount(long accNo) throws ParseException;
}
